﻿using System.Collections.Generic;
using com.loto.Common.DBUtility;
using com.huigo.Framework.Model;
using System.Data.SqlClient;
using System;

namespace com.huigo.Framework.BLL
{
    public class CustExtInfo
    {
        public static Model.CustExtInfo GetCustExtInfoById(long id)
        {
            Model.CustExtInfo custExtInfo = new Model.CustExtInfo();
            custExtInfo.ExtCustFid = id;
            return SqlServerDal.CustExtInfo.GetItem(custExtInfo, null, null, null);
        }

        public static bool UpdateCustExtInfo(long cid, Model.CustExtInfo custExtInfo)
        {
            List<WhereStatement> whereList = new List<WhereStatement>()
            {
                    new WhereStatement("EXT_CUST_FID","=",cid.ToString(),"")
            };
            return SqlServerDal.CustExtInfo.Update(custExtInfo, whereList, null);
        }
        /// <summary>
        /// 经销商注册
        /// </summary>
        /// <param name="custExtInfo"></param>
        /// <returns></returns>
        public static long insertCustExtInfo(Model.CustExtInfo custExtInfo)
        {
            return Convert.ToInt64(SqlServerDal.CustExtInfo.Insert(custExtInfo, null));
        }
    }
}
